package dmp.cjh.url.domain;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

public class DomainGetReducer extends Reducer<Text, LongWritable, Text,NullWritable> {
	private Map<Long, String> map=new HashMap();
	@Override
	protected void reduce(Text key, Iterable<LongWritable> values, Context context) throws IOException, InterruptedException {
		long count=0;
		for (LongWritable value : values) {
//			count++;
		}
		context.write(new Text(key), NullWritable.get());
//		map.put(count, key.toString());
	}
	
//	@Override
//	protected void cleanup(Reducer<Text, LongWritable, Text, NullWritable>.Context context) throws IOException, InterruptedException {
//		long count=0;
//		Set<Long> keys = map.keySet();
//		
//		for (Long key : keys) {
//			if(count>2){
//				String value=map.get(key);
//				context.write(new Text(value), NullWritable.get());
//			}else{
//				count=0;
//				break;
//			}
//		}
//	}
}
